package org.darkforest.common.services;

import org.darkforest.model.VoucherTpl;

import java.util.List;

/**
 * Created by Administrator on 2015/12/30.
 *
 * 优惠券
 */
public interface VoucherTemplateService {

    int deleteByPrimaryKey(Integer voucherTId);

    int insert(VoucherTpl record);

    int insertSelective(VoucherTpl record);

    VoucherTpl selectByPrimaryKey(Integer voucherTId);

    int updateByPrimaryKeySelective(VoucherTpl record);

    int updateByPrimaryKey(VoucherTpl record);

    /**
     * 根据条件分页查询代金券
     * @param voucherTpl
     * @return
     */
    VoucherTpl selectVoucherTplListByPage(VoucherTpl voucherTpl);

    /****
     * 定时修改过期代金券的数据状态
     */
     void voucherTask();

    /**
     * 更新模板中已经使用的优惠券数量
     * @param voucherTId
     */
    void updateVoucherTplUserNumber(Integer voucherTId);

    public List<VoucherTpl> selectVoucherTplList(VoucherTpl voucherTpl);

    public List<VoucherTpl> selectVoucherTplListAndVoucherNum(VoucherTpl voucherTpl);
}
